import random

def generateRight(dificulty):
    return getOperation(dificulty)
    #a,  b,  result,  operation = getOperation(dificulty)
    #return str(a) + ' ' + operation + ' ' + str(b) + ' = ' + str(result)

def generateWrong(dificulty):
    a,  b,  result,  operation = getOperation(dificulty)
    
    #strin = str(a) + ' ' + operation + ' ' + str(b) + ' = '
    
    if operation == '+':
        result = result+random.randint(1, 3)
    elif operation == '-':
        result = result+random.randint(1, 3)
    elif operation == 'x':
        result = result + a
    else:
        result = b+random.randint(1, 3)
    #strin += ' ' + str(result)
    #return strin
    return a,  b,  result, operation  

def getOperation(dificulty):
    operation = random.randint(0,  dificulty)
    if operation == 0:
        a = random.randint(0, 49)
        b = random.randint(0, 50)
        add = a+b
        return a,  b,  add,  '+'
    elif operation == 1:
        a = random.randint(0, 99)
        b = random.randint(0, a)
        minus = a-b
        return a,  b,  minus,  '-'
    elif operation == 2:
        a = random.randint(0, 9)
        b = random.randint(0, 10)
        product = a*b
        return a,  b,  product,  'x'
    else:
        a = random.randint(0, 9)
        b = random.randint(0, 10)
        div = a*b
        return div,  a,  b,  '/'
